package com.booza.model;

import java.io.Serializable;
import java.util.Date;
import java.util.HashSet;
import java.util.Set;

import org.apache.commons.lang.StringUtils;

/**
 * Value object for user accounts.
 */
public class Account implements Serializable
{
	private static final long serialVersionUID = 851983969548304440L;
	
	private static final String DEFAULT_CURRENCY_CODE = "2"; // GBP 
	
	private Integer accountid;
	private String firstname;
	private String lastname;
	private String city;
	private String state;
	private String country;
	private String phone;
	private String email;
	private String emailnew;
	private String username;
	private String password;
	private String photo;
	private Integer status;
	private String gender;
	private Date createdate;
	private Date lastlogindate;
	private Integer zoneid;
	private String about;
	private Short privacy;
	private Integer credits;
	private Integer totalwinnings;
	private String addintionalinfo;
	private String userid;
	private Double ranking;
	private boolean messages = true;
	private boolean invitations = true;
	private boolean reminders = true;
	private Integer pagePref;
	private String confirmation;
	private Set statsesForPlayer2 = new HashSet(0);
	private Set statsesForPlayer1 = new HashSet(0);
	private Set friendsForAccountid = new HashSet(0);
	private Set tournamentplayerses = new HashSet(0);
	private Set friendsForFriendid = new HashSet(0);
	private Set tournaments = new HashSet(0);
	private String currency = DEFAULT_CURRENCY_CODE;
	private Date dob;
	private TimeZone zoneInfo;
	private boolean frndRequests = true;
	private PlayerStatus onlineStatus;
	
	/*
	 * Default payment gateway for user
	 */
	private String paymentGateway;

	/**
	 * Non-persistent fields. Does not correspond to any field in account table.
	 */
	private Integer noOfGames;
	private String playerClassification;

	/**
	 * Property to hold successive login failure count for the user id.
	 */
	private int loginFailureCount;
	
	public String getPlayerClassification()
	{
		return playerClassification;
	}

	public void setPlayerClassification(String playerClassification)
	{
		this.playerClassification = playerClassification;
	}

	public Integer getNoOfGames()
	{
		return noOfGames;
	}

	public void setNoOfGames(Integer noOfGames)
	{
		this.noOfGames = noOfGames;
	}

	public Date getDob()
	{
		return dob;
	}

	public void setDob(Date dob)
	{
		this.dob = dob;
	}

	public String getCurrency()
	{
		return currency;
	}

	public void setCurrency(String currency)
	{
		this.currency = currency;
	}

	public Account() {
	}

	public Integer getAccountid()
	{
		return this.accountid;
	}

	public void setAccountid(Integer accountid)
	{
		this.accountid = accountid;
	}

	public String getFirstname()
	{
		return this.firstname;
	}

	public void setFirstname(String firstname)
	{
		this.firstname = firstname;
	}

	public String getLastname()
	{
		return this.lastname;
	}

	public void setLastname(String lastname)
	{
		this.lastname = lastname;
	}

	public String getCity()
	{
		return this.city;
	}

	public void setCity(String city)
	{
		this.city = city;
	}

	public String getState()
	{
		return this.state;
	}

	public void setState(String state)
	{
		this.state = state;
	}
	
	public String getPhone()
	{
		return this.phone;
	}

	public void setPhone(String phone)
	{
		this.phone = phone;
	}

	public String getEmail()
	{
		return this.email;
	}

	public void setEmail(String email)
	{
		this.email = email;
	}

	public String getEmailnew()
	{
		return emailnew;
	}

	public void setEmailnew(String emailnew)
	{
		this.emailnew = emailnew;
	}

	public String getUsername()
	{
		return StringUtils.trim(this.username);
	}

	public void setUsername(String username)
	{
		this.username = StringUtils.trim(username);
	}

	public String getPassword()
	{
		return StringUtils.trim(this.password);
	}

	public void setPassword(String password)
	{
		this.password = StringUtils.trim(password);
	}

	public String getPhoto()
	{
		return this.photo;
	}

	public void setPhoto(String photo)
	{
		this.photo = photo;
	}

	public Integer getStatus()
	{
		return this.status;
	}

	public void setStatus(Integer status)
	{
		this.status = status;
	}

	public String getGender()
	{
		return this.gender;
	}

	public void setGender(String gender)
	{
		this.gender = gender;
	}

	public Date getCreatedate()
	{
		return this.createdate;
	}

	public void setCreatedate(Date createdate)
	{
		this.createdate = createdate;
	}

	public Date getLastlogindate()
	{
		return this.lastlogindate;
	}

	public void setLastlogindate(Date lastlogindate)
	{
		this.lastlogindate = lastlogindate;
	}

	public Integer getZoneid()
	{
		return this.zoneid;
	}

	public void setZoneid(Integer zoneid)
	{
		this.zoneid = zoneid;
	}

	public String getAbout()
	{
		return this.about;
	}

	public void setAbout(String about)
	{
		this.about = about;
	}

	public Short getPrivacy()
	{
		return this.privacy;
	}

	public void setPrivacy(Short privacy)
	{
		this.privacy = privacy;
	}

	public Integer getCredits()
	{
		return this.credits;
	}

	public void setCredits(Integer credits)
	{
		this.credits = credits;
	}

	public Integer getTotalwinnings()
	{
		return this.totalwinnings;
	}

	public void setTotalwinnings(Integer totalwinnings)
	{
		this.totalwinnings = totalwinnings;
	}

	public String getAddintionalinfo()
	{
		return this.addintionalinfo;
	}

	public void setAddintionalinfo(String addintionalinfo)
	{
		this.addintionalinfo = addintionalinfo;
	}

	public boolean isMessages()
	{
		return this.messages;
	}

	public void setMessages(boolean messages)
	{
		this.messages = messages;
	}

	public boolean isInvitations()
	{
		return this.invitations;
	}

	public void setInvitations(boolean invitations)
	{
		this.invitations = invitations;
	}

	public boolean isReminders()
	{
		return this.reminders;
	}

	public void setReminders(boolean reminders)
	{
		this.reminders = reminders;
	}

	public String getConfirmation()
	{
		return this.confirmation;
	}

	public void setConfirmation(String confirmation)
	{
		this.confirmation = confirmation;
	}

	public Set getStatsesForPlayer2()
	{
		return this.statsesForPlayer2;
	}

	public void setStatsesForPlayer2(Set statsesForPlayer2)
	{
		this.statsesForPlayer2 = statsesForPlayer2;
	}

	public Set getStatsesForPlayer1()
	{
		return this.statsesForPlayer1;
	}

	public void setStatsesForPlayer1(Set statsesForPlayer1)
	{
		this.statsesForPlayer1 = statsesForPlayer1;
	}

	public Set getFriendsForAccountid()
	{
		return this.friendsForAccountid;
	}

	public void setFriendsForAccountid(Set friendsForAccountid)
	{
		this.friendsForAccountid = friendsForAccountid;
	}

	public Set getTournamentplayerses()
	{
		return this.tournamentplayerses;
	}

	public void setTournamentplayerses(Set tournamentplayerses)
	{
		this.tournamentplayerses = tournamentplayerses;
	}

	public Set getFriendsForFriendid()
	{
		return this.friendsForFriendid;
	}

	public void setFriendsForFriendid(Set friendsForFriendid)
	{
		this.friendsForFriendid = friendsForFriendid;
	}

	public Set getTournaments()
	{
		return this.tournaments;
	}

	public void setTournaments(Set tournaments)
	{
		this.tournaments = tournaments;
	}

	public static long getSerialVersionUID()
	{
		return serialVersionUID;
	}

	public String getUserid()
	{
		return StringUtils.trim(userid);
	}

	public void setUserid(String userid)
	{
		this.userid = StringUtils.trim(userid);
	}

	public String getCountry()
	{
		return country;
	}

	public void setCountry(String country)
	{
		this.country = country;
	}

	public Double getRanking()
	{
		return ranking;
	}

	public void setRanking(Double ranking)
	{
		this.ranking = ranking;
	}

	public TimeZone getZoneInfo()
	{
		return zoneInfo;
	}

	public void setZoneInfo(TimeZone zoneInfo)
	{
		this.zoneInfo = zoneInfo;
	}

	public boolean isFrndRequests()
	{
		return frndRequests;
	}

	public void setFrndRequests(boolean frndRequests)
	{
		this.frndRequests = frndRequests;
	}

	/**
	 * @return the onlineStatus
	 */
	public PlayerStatus getOnlineStatus() 
	{
		return onlineStatus;
	}

	/**
	 * @param onlineStatus the onlineStatus to set
	 */
	public void setOnlineStatus(PlayerStatus onlineStatus) 
	{
		this.onlineStatus = onlineStatus;
	}

	/**
	 * @return the pagePref
	 */
	public Integer getPagePref() 
	{
		return pagePref;
	}

	/**
	 * @param pagePref the pagePref to set
	 */
	public void setPagePref(Integer pagePref) 
	{
		this.pagePref = pagePref;
	}
	
	public String getPaymentGateway() 
	{
		return paymentGateway;
	}

	public void setPaymentGateway(String paymentGateway) 
	{
		this.paymentGateway = paymentGateway;
	}

	/**
	 * @return the loginFailureCount
	 */
	public int getLoginFailureCount() {
		return loginFailureCount;
	}

	/**
	 * @param loginFailureCount the loginFailureCount to set
	 */
	public void setLoginFailureCount(int loginFailureCount) {
		this.loginFailureCount = loginFailureCount;
	}
}
